import React from 'react';
import { Home, Resources, RoadMap, Center, Detail, Info, Love } from '@/pages';

export interface IRoute {
  title: string;
  icon: string;
  path: string;
  element: JSX.Element;
  children?: IRoute[];
  index?: boolean;
}

export const navs: IRoute[] = [
  {
    title: '首页',
    icon: '',
    path: '/',
    element: <Home />
  },
  {
    title: '资源',
    icon: '',
    path: '/resources',
    element: <Resources />
  },
  {
    title: '学习路线',
    icon: '',
    path: '/roadmap',
    element: <RoadMap />
  },
];

export const routes: IRoute[] = [
  ...navs,
  {
    title: '个人中心',
    path: '/center',
    icon: '',
    element: <Center />,
    children: [
      {
        title: '个人信息',
        path: 'info',
        icon: '',
        element: <Info />,
        index: true,
      },
      {
        title: '我的喜欢',
        path: 'love',
        icon: '',
        element: <Love />,
      },
      
    ]
  },
  {
    title: '资源详情',
    icon: '',
    path: '/detail/:resourceId',
    element: <Detail />,
  },
];
